<?php
class RoleModel extends Model{
	
	protected $_auto = array (
		array('status','1'),  // 新增的时候把status字段设置为1
	);
	
	protected $_validate = array(
		array('name','require','name required'),
	);
	
	
	public function getAllRoles(){
		//$where['status'] = 1;
		$roles = $this->where($where)->order('sort desc')->select();
		return $roles;
	}
	
	
	
}

?>